package cn.com.lyj6851.modules.user.controller;

import cn.com.lyj6851.logging.aop.AopLog;
import cn.com.lyj6851.modules.user.service.YdyUserBillService;
import cn.com.lyj6851.modules.user.service.dto.YdyUserBillQueryCriteria;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
*
*/
@Api(tags = "商城:用户账单管理")
@RestController
@RequestMapping("api")
public class UserBillController {

    private final YdyUserBillService yxUserBillService;

    public UserBillController(YdyUserBillService yxUserBillService) {
        this.yxUserBillService = yxUserBillService;
    }

    @AopLog("查询")
    @ApiOperation(value = "查询")
    @GetMapping(value = "/ydyUserBill")
    @PreAuthorize("hasAnyRole('admin','USERBILL_ALL','USERBILL_SELECT')")
    public ResponseEntity getYdyUserBills(YdyUserBillQueryCriteria criteria, Pageable pageable){
        return new ResponseEntity<>(yxUserBillService.queryAll(criteria,pageable),HttpStatus.OK);
    }

}
